import 'package:flutter_smart_heating/common/http.dart';
import 'package:get/get.dart';

import 'state.dart';

class BroadcastDetailLogic extends GetxController {
  final state = BroadcastDetailState();

  fetchData() async {
    var res = await Http.instance.post(
      '/plugin/broadcast/api/detail',
      data: {'id': Get.parameters['id']},
    );
    state.stateController.setStatus(res);
    if (res.code == 1) {
      state.row = res.data;
    }
    update();
  }
}
